package com.ytjj.qmyx.admin.service.impl;

import com.github.pagehelper.PageHelper;
import com.ytjj.common.api.CommonPage;
import com.ytjj.qmyx.admin.dao.HotProductBannerDao;
import com.ytjj.qmyx.admin.model.response.HotProductBannerResponse;
import com.ytjj.qmyx.admin.service.HotProductBannerService;
import com.ytjj.qmyx.mall.model.HotProductBanner;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 *
 *
 * @Version: 1.0
 */
@Service
public class HotProductBannerServiceImpl implements HotProductBannerService {

    @Resource
    private HotProductBannerDao hotProductBannerDao;

    @Override
    public CommonPage<HotProductBannerResponse> selectList(Integer hotProductId, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return CommonPage.restPage(hotProductBannerDao.selectList(hotProductId));
    }

    @Override
    public Integer insertBanner(HotProductBanner hotProductBanner) {
        return hotProductBannerDao.insertBanner(hotProductBanner);
    }

    @Override
    public Integer updateBanner(HotProductBanner hotProductBanner) {
        return hotProductBannerDao.updateBanner(hotProductBanner);
    }

    @Override
    public Integer removeBanner(Integer id) {
        return hotProductBannerDao.removeBanner(id);
    }
}
